package com.mage;

import com.mage.model.Book;
import com.mage.util.FreemarkerUtil;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 *	测试内置指令
 */
public class FreemarkerApp09 {
	
	public static void main(String[] args) throws Exception {
		Map<String, Object> dataModel = new HashMap<>();
		List<Book> books = Stream.of(new Book[] {
				new Book(1, "西游记", "吴承恩"),
				new Book(2, "三国演义", "罗贯中"),
				new Book(3, "水浒传", "施耐庵"),
				new Book(4, "红楼梦", "曹雪芹"),
		}).collect(Collectors.toList());
		dataModel.put("books", books);
		FreemarkerUtil.generate("sequence_datatype", dataModel, "src/main/templates", "src/main/out");

	}
}
